//
// Created by htlin on 2021/3/1 0001.
//

#ifndef LIBUVTEST_THREAD_H
#define LIBUVTEST_THREAD_H

#include "header.h"

class ThreadPrivateData;

class Thread {

public:

    static uv_thread_t getThreadId();

public:
    explicit Thread();

    virtual ~Thread();

    void start();

    bool isRunning() const;

protected:
    virtual void prepare();

    virtual void run();

private:
    void initializeData();

private:
    static void threadCB(void *data);

private:
    std::unique_ptr<ThreadPrivateData> data;
};


#endif //LIBUVTEST_THREAD_H
